From: Florian Müllner Date: Thu, 4 Oct 2012 18:03:57 +0000 (+0200) Subject: modalDialog: Add alternative keys to activate default X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~5669 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=55284e418cc7ff8729b8a7711fec85c2bd5ec134;p=gnome-shell.git modalDialog: Add alternative keys to activate default Currently Return is used to activate the default button of a modal dialog if no key is specified. It makes sense to allow alternatives as the keypad's Enter key as well in this case. https://bugzilla.gnome.org/show_bug.cgi?id=685511 --- diff --git a/js/ui/modalDialog.js b/js/ui/modalDialog.js index f0c934676..3f7233f9a 100644 --- a/js/ui/modalDialog.js +++ b/js/ui/modalDialog.js @@ -131,8 +131,11 @@ const ModalDialog = new Lang.Class({ let key = buttonInfo['key']; let isDefault = buttonInfo['default']; - if (isDefault && !key) + if (isDefault && !key) { + this._actionKeys[Clutter.KEY_KP_Enter] = action; + this._actionKeys[Clutter.KEY_ISO_Enter] = action; key = Clutter.KEY_Return; + } buttonInfo.button = new St.Button({ style_class: 'modal-dialog-button', reactive: true,